package sei.excel;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import sei.cloud.common.support.ResMsg;
import sei.excel.reader.ExcelReader;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

@RestController
@Api(description = "接口")
@RequestMapping("/api/test")
public class TestController {
    @Resource
    ExcelReader excelReader;

    @ApiOperation(value = "读取文档")
    @PostMapping("/read")
    public void testReader() throws IOException {
          String filepath = "F:/dianli/sql/sys_org123.xls";
//        File file = new File(filepath);
        excelReader.exportToDB(filepath,2);
    }

}
